-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make allow
attribute configurable in iframe panel
#19087
Make allow
attribute configurable in iframe panel
#19087
Conversation
Your code does not match with your example, your example is for the dashboard iframe card but your code is for the iframe panel. |
Thank you very much, @bramkragten! I have now added the same-ish logic to the iframe card that I had added to the iframe panel. I could not test this, so most likely it doesn't work yet. Is there someone familiar with the project who could verify this? |
Co-authored-by: Quentame <[email protected]>
Co-authored-by: Quentame <[email protected]>
Co-authored-by: Quentame <[email protected]>
src/panels/iframe/ha-panel-iframe.ts
Outdated
@@ -41,7 +41,7 @@ class HaPanelIframe extends LitElement { | |||
)} | |||
src=${this.panel.config.url} | |||
sandbox="allow-forms allow-popups allow-pointer-lock allow-same-origin allow-scripts allow-modals allow-downloads" | |||
allow="fullscreen" | |||
allow=${this.panel.config.allow ?? 'fullscreen'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires a backend change, please link to the core PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, not sure what PR you're referring to. Could you clarify?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config of this panel is provided by core, so you will need to update core too for this to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I have tried my luck: home-assistant/core#108230. I very much admit that this is a bit out of my comfort zone.
Co-authored-by: Bram Kragten <[email protected]>
Is #19087 jointly with home-assistant/core#108230 ready to be merged? Anything else needed from my end? @Quentame, you were involved in reviewing both. Thanks for your review again! |
I have addressed the conflicts. Could you please take another look? |
The iframe panel is deprecated, we introduced the new webpage dashboard that will replace it. So can you please remove the code for the panel, then we can merge the code for the card. |
Removed the iframe panel code. PTAL. |
Thanks! Please add a documentation PR for this feature |
|
Hello, Would it be possible to add this option on iframe panel ? Thanks for your crazy work ! |
Proposed change
The iframe panel lets users embed arbitrary content. One use case is embedding widgets that interact with WebUSB (a concrete example is my Enphase Solar monitor that flashes a WebUSB-connected LED red or green based on the current power production). For this to work, the iframe needs to be granted USB access, which happens via the Permissions-Policy usb (
<iframe allow="usb">
.I tried to start a discussion about this in #19028, but it's maybe too niche.
Type of change
Example configuration
(I hope that this would work.)
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: